import {defineStore} from "pinia";
import {formatMonthDay} from "@/utils/formatDate";

const startDate = new Date()
const endDate = new Date().setDate(startDate.getDate() + 1)

const useMain = defineStore('main', {
   state: () => ({
      startDate,
      endDate,
      isLoading: false
   }),
   getters: {
      startDateStr: state =>
         format => formatMonthDay(state.startDate, format),
      endDateStr: state =>
         format => formatMonthDay(state.endDate, format)
   }
})

export default useMain